import React from 'react';
import { Space, Tag, Table } from 'antd';
import tab from '@/hoc/tab';
let params = ' /getServiceLog';
function list(props: any) {
  const { arr, fatherecho, total } = props;
  const columns: any = [
    {
      title: 'ID',
      dataIndex: 'vsid',
    },
    {
      title: '游客id',
      dataIndex: 'visitor_id',
    },
    {
      title: '游客名称',
      dataIndex: 'visitor_name',
    },
    {
      title: '游客头像',
      dataIndex: 'visitor_avatar ',
      render: (_: any, record: any) => (
        <Space size="middle">
          <img
            src={`http://fangadmin.shbwyz.com${record.visitor_avatar}`}
            style={{ width: 50, height: 50 }}
          ></img>
        </Space>
      ),
    },
    {
      title: '在线状态',
      dataIndex: 'connect_stauts',
      render: (_: any, record: any) => (
        <Space size="middle">
          <span>
            {record.online_status === '1' ? (
              <Tag color="error">离线</Tag>
            ) : (
              <Tag color="success">上线</Tag>
            )}
          </span>
        </Space>
      ),
    },
    {
      title: `IP`,
      dataIndex: 'visitor_ip',
    },
    {
      title: '创建时间',
      dataIndex: 'start_date',
    },
    {
      title: '结束时间',
      dataIndex: 'end_date',
    },
  ];
  return (
    <div>
      <Table
        columns={columns}
        dataSource={arr}
        pagination={{ pageSize: 5, showQuickJumper: true, total }}
      />
    </div>
  );
}
export default tab(list, params);
